//@+leo-ver=5-thin
//@+node:caminhante.20210214143558.1: * @file server.js
//@+others
//@+node:caminhante.20210214144959.1: ** class SMTPEmail
function SMTPEmail (_options) {
  // STUB
  function send (data) {}
  return {send}
}
//@+node:caminhante.20210214145411.1: ** class SendmailEmail
function SendmailEmail (_options) {
  // STUB
  function send (data) {}
  return {send}
}
//@+node:caminhante.20210214144331.1: ** class SendEmailMethod
function SendEmailMethod (_method) {
  var _newEmail
  if (_method=="SMTP") { _newEmail = SMTPEmail }
  else if (_method=="Sendmail") { _newEmail = SendmailEmail }
  else { throw("Unsupported email method") }
  function method () { return _method }
  function setup (options) { return new _newEmail(options) }
  return {method,setup}
}
//@+node:caminhante.20210214150430.1: ** class CryptoMethod
function CryptoMethod (_method) {
  switch (true) {
    case _method=="SSL/TLS": break;
    case _method=="STARTTLS": break;
    default: throw("Unsupported crypto method"); }
  function method () { return _method }
  return {method}
}
//@+node:caminhante.20210214150959.1: ** class EmailAddress
function EmailAddress(_username, _serverDomain) {
  function toString () { return username+'@'+serverDomain }
  function username () { return _username }
  function serverDomain () { return _serverDomain }
  return {toString,username,serverDomain}
}
//@+node:caminhante.20210214151301.1: ** class AuthenticationMethod
function AuthenticationMethod (_method) {
  switch (true) {
    case _method=="None": break;
    case _method=="Password": break;
    case _method=="PasswordHash": break;
    case _method=="Kerberos": break;
    case _method=="TLSCert": break;
    case _method=="OAuth2": break;
    default: throw("Unsupported authentication method"); }
  function method () { return _method }
  return {method}
}
//@+node:caminhante.20210214152304.1: ** class PasswordSecret
function PasswordSecret (_password, _hashAlgorithm) {
  function hash () { return _hashAlgorithm.hash(_password) }
  function plain (receiver) { return receiver.plain(_password) }
  return {hash,plain}
}
//@+node:caminhante.20210214151746.1: ** class MailServerAddress
function MailServerAddress (_address, _port) {
  function toString () { return _address+':'+_port }
  function address () { return _address }
  function port () { return _port }
  return {toString,address,port}
}
//@+node:caminhante.20210214152040.1: ** class MailConnectionCredential
function MailConnectionCredential (_authMethod, _secret) {
  // STUB
}
//@+node:caminhante.20210214144235.1: ** class EmailSender
//@+at
// docs coming
//@@c
function EmailSender (_sendEmailMethod, _fromAddr, _mailServerAddr, _credential) {
  //@+others
  //@-others
}
//@-others
//@-leo
